package sctu.edu.java.year2016.team07.shihaocheng.day20160530.chapter9_3;

/**
 * Created by admin on 2016/5/30.
 */
public class Test3 {
    public static void main(String[] args)
    {
       Animal pig = new Animal() {




           @Override
           public void eat() {
               System.out.println("pig can eat!");
           }



           @Override
           public void sleep() {
               System.out.println("pig can sleep!");
           }
       };



         pig.eat();
         pig.sleep();
    }
}
